#include<iostream>
#include<cmath>

using namespace std;
using ll=long long;

bool check1(ll x) {
    ll r = sqrt(x);
    if (r * r != x)return false;
    ll a = sqrt(2.0 * x), b = sqrt(2.0 * x) + 1;
    return a * (a + 1) / 2 == x || b * (b + 1) / 2 == x;
}

int main() {
    for (ll x; cin >> x;) {
        if (check1(x))
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}